#include<bits/stdc++.h>
const int BUF_SIZ=1<<18;
char ibuf[BUF_SIZ],*iS=ibuf,*iT=ibuf;
#define getchar() (iS==iT&&(iT=(iS=ibuf)+fread(ibuf,1,BUF_SIZ,stdin)),iS==iT?EOF:*iS++)
template <typename _Tp>void read(_Tp &x){
	char ch(getchar());bool f(false);while(!isdigit(ch))f|=ch==45,ch=getchar();
	x=ch&15,ch=getchar();while(isdigit(ch))x=x*10+(ch&15),ch=getchar();
	if(f)x=-x;
}
template <typename _Tp,typename... Args>void read(_Tp &t,Args &...args){read(t);read(args...);}
using namespace std;
typedef struct{
	long long h,r,R;
	long double v;
}WAN;
WAN a[1000011];
long double Dis(int l,int n)//last,new
{
	if(a[n].r >= a[l].R)
		return a[l].h;//3
	if((a[n].R - a[n].r) * a[l].h > (a[l].R - a[l].r) * a[n].h)//1,2
	{
		if((a[n].R - a[l].r) * a[l].h <= (a[l].R - a[l].r) * a[n].h)
			return 0;//1.3
		if((a[l].R - a[n].r) * a[n].h >= (a[n].R - a[n].r) * a[l].h)
			return 0;//1.2
		if(a[n].R > a[l].R)
			return a[l].h - a[n].h * (a[l].R - a[n].r) * 1.0 / (a[n].R - a[n].r);//2
		else
			return (a[n].R - a[l].r) * a[l].h * 1.0 / (a[l].R - a[l].r) - a[n].h;//5
	}else{
		if(a[n].r <= a[l].r)
			return 0;//1.1
		return (a[n].r - a[l].r) * a[l].h * 1.0 / (a[l].R - a[l].r);//4
	}
}
int st[1000011],top;
int n;
int main()
{
	freopen("wan.in","r",stdin);
	freopen("wan.out","w",stdout);
	read(n);
	for(int i = 1;i <= n;i++)
		read(a[i].h,a[i].r,a[i].R);
	for(int i = 1;i <= n;i++)
	{
		while(top)
		{
			a[i].v = max(a[i].v,a[st[top]].v + Dis(st[top],i));
			if(a[i].v + a[i].h >= a[st[top]].v + a[st[top]].h)
				top--;
			else
				break;
		}
		st[++top] = i;
	}
	cout << fixed << setprecision(8) << a[st[1]].v + a[st[1]].h;
	return 0;
}
